//===============================================================================
// Microsoft patterns & practices
// Guidance Explorer Offline Client
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================


using System.Windows.Forms;
using GuidanceExplorer.Model;

namespace GuidanceExplorer.Controls
{
    //[GuidanceTypeMenuItemAttribute(500, "context\\New Item", GuidanceExplorer.Commands.NewGuidanceItem, typeof(ModelItemMenuItemIsEditableCondition), typeof(NewGuidanceTypeItemMenuItemProvider), Keys.None)]
    [GuidanceTypeMenuItemAttribute(510, "context\\Import Item...", GuidanceExplorer.Commands.ImportGuidanceItemToLibrary, typeof(ModelItemMenuItemIsEditableCondition), Keys.None)]
    //[MenuItemAttribute(515, "context\\-", null, typeof(ModelItemMenuItemIsEditableCondition), Keys.None)]
    //[MenuItemAttribute(520, "context\\Save View As...", GuidanceExplorer.Commands.SaveLibraryAs, Keys.None)]
    [MenuItemAttribute(525, "context\\E&xport as Library...", GuidanceExplorer.Commands.ExportViewAsLibrary, Keys.None) ]
    //[MenuItemAttribute(530, "context\\-", null, typeof(WebSubscribedLibraryCondition), Keys.None)]
    //[MenuItemAttribute(540, "context\\Synchronize Library", Commands.Synchronize, typeof(WebSubscribedLibraryCondition), Keys.None)]
#if ONLINEENABLED
    [MenuItemAttribute(550, "context\\Publish (experimental)...", GuidanceExplorer.Commands.PublishGuidanceType, Keys.None)]
#endif
    public class GuidanceTypeNode : ModelNode<GuidanceType>
    {
        /// <summary>
        /// Factory.
        /// </summary>
        /// <returns></returns>
        public static GuidanceTypeNode New()
        {
            return new GuidanceTypeNode();
        }
        
        /// <summary>
        /// The columns for this guidance type.
        /// </summary>
        private ColumnCollection _columns;

        /// <summary>
        /// Default constructor.
        /// </summary>
        private GuidanceTypeNode() : base("<a guidancetype>", 0, 0) { }

        /// <summary>
        /// The GuidanceType instance.
        /// </summary>
        public override GuidanceType ModelInstance
        {
            set
            {
                base.ModelInstance = value;
            }
        }

        /// <summary>
        /// The columns for this guidance type.
        /// </summary>
        public ColumnCollection Columns
        {
            get { return _columns; }
            set { _columns = value; }
        }

        /// <summary>
        /// Whether the node is editable.
        /// </summary>
        public override bool IsEditable
        {
            get { return false; } //Type nodes cannot be modified by user
        }

    }
}

